/*
 * ExtensibleHelper.java
 *
 * Created on 16.06.2007, 00:06:41
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package de.tor.util.helpers;

import java.io.Serializable;
import java.util.Properties;

/**
 *
 * @author Charon
 */
public class ExtensibleHelper implements Serializable {
    
    private Properties extensions = null;
    
    public ExtensibleHelper() {
        extensions = new Properties();
    }
    
    public void setExtensions(Properties extensions){
        this.extensions = extensions;
    }
    
    public Properties getExtensions(){
        return extensions;
    }
    
    public <C>C getExtension(String key){
        try{
            return (C)extensions.get(key);
        }catch(Exception e){
            return null;
        }
    }
    
    public void addExtension(String key, Object value){
        extensions.put(key, value);
    }
    
    public void removeExtension(String key){
        extensions.remove(key);
    }
    
}
